using System;

namespace CastleSample.UnitTest.Common
{
    public class RandomGen
    {
        private static Random m_Random = new Random();

        public static bool GetBool()
        {
            return m_Random.Next(2) == 1;
        }

        public static string GetString(string prefix, int length)
        {
            if (length <= 0)
            {
                length = 2;
            }
            string str = "";
            for (int i = 0; i < length; i++)
            {
                str += m_Random.Next(10).ToString();
            }
            return prefix + str;
        }

        public static int GetInt(int minValue, int maxValue)
        {
            int ret = m_Random.Next(maxValue - minValue);
            return minValue + ret;
        }
    }
}